import http from "@/config/config";

const flavourApi ={
     
    getFlavour:()=>{
         return http.get('/flavour').then(res=>{
             return res.data;
         })
    },
    //添加口味
    addFlavour:(flavour:String)=>{
        return http.post('/flavour/add',{
            "flavour":flavour
        }).then(res=>{
            return res.data;
       })
    },
    //修改口味
    updateFlavour:(flavour:any)=>{
        return http.put('/flavour/update',{
            "id":flavour.id,
            "flavour":flavour.flavour
        }).then(res=>{
            return res.data;
        })
    },
    //批量删除口味
    deleteFlavours:(ids:any)=>{
        return http.post('/flavour/delete',{
            "ids":ids
        }).then(res=>{
            return res.data;
        })
    }

}

export default flavourApi;

